package com.mega.ycy.mixin;

import mods.flammpfeil.slashblade.ItemSlashBlade;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import org.apache.commons.lang3.reflect.MethodUtils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import javax.annotation.Nullable;

@Mixin(ItemStack.class)
public abstract class ItemStackMixin {

    /**
     * @author isItemStackDamageable()Z
     */
    @Inject(method = "func_77984_f", at = @At("HEAD"), cancellable = true)
    public void isItemStackDamageable(CallbackInfoReturnable<Boolean> cir) {
        if (((ItemStack)(Object)this).item.getClass().getSimpleName().equals("ItemAYiSlashBlade")) {
            cir.setReturnValue(false);
        }
    }

}
